package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * WorkOrder generated by hbm2java
 */
@Entity
@Table(name = "work_order")
public class WorkOrder implements java.io.Serializable {

	private Long id;
	private Rank rank;
	private MainPoint mainPoint;
	private MainPointModule mainPointModule;
	private Topic topic;
	private String workOrderName;
	private boolean workOrderState;
	private byte workOrderType;
	private Set<QualityInspection> qualityInspections = new HashSet<QualityInspection>(
			0);
	private Set<WorkOrderDetail> workOrderDetails = new HashSet<WorkOrderDetail>(
			0);
	private Set<SkillVerify> skillVerifies = new HashSet<SkillVerify>(0);
	private Set<StudentRecommend> studentRecommends = new HashSet<StudentRecommend>(
			0);

	public WorkOrder() {
	}

	public WorkOrder(String workOrderName, boolean workOrderState,
			byte workOrderType) {
		this.workOrderName = workOrderName;
		this.workOrderState = workOrderState;
		this.workOrderType = workOrderType;
	}

	public WorkOrder(Rank rank, MainPoint mainPoint,
			MainPointModule mainPointModule, Topic topic, String workOrderName,
			boolean workOrderState, byte workOrderType,
			Set<QualityInspection> qualityInspections,
			Set<WorkOrderDetail> workOrderDetails,
			Set<SkillVerify> skillVerifies,
			Set<StudentRecommend> studentRecommends) {
		this.rank = rank;
		this.mainPoint = mainPoint;
		this.mainPointModule = mainPointModule;
		this.topic = topic;
		this.workOrderName = workOrderName;
		this.workOrderState = workOrderState;
		this.workOrderType = workOrderType;
		this.qualityInspections = qualityInspections;
		this.workOrderDetails = workOrderDetails;
		this.skillVerifies = skillVerifies;
		this.studentRecommends = studentRecommends;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "RANK_ID")
	public Rank getRank() {
		return this.rank;
	}

	public void setRank(Rank rank) {
		this.rank = rank;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MAIN_POINT_ID")
	public MainPoint getMainPoint() {
		return this.mainPoint;
	}

	public void setMainPoint(MainPoint mainPoint) {
		this.mainPoint = mainPoint;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MAIN_POINT_MODULE_ID")
	public MainPointModule getMainPointModule() {
		return this.mainPointModule;
	}

	public void setMainPointModule(MainPointModule mainPointModule) {
		this.mainPointModule = mainPointModule;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TOPIC_ID")
	public Topic getTopic() {
		return this.topic;
	}

	public void setTopic(Topic topic) {
		this.topic = topic;
	}

	@Column(name = "WORK_ORDER_NAME", nullable = false, length = 60)
	public String getWorkOrderName() {
		return this.workOrderName;
	}

	public void setWorkOrderName(String workOrderName) {
		this.workOrderName = workOrderName;
	}

	@Column(name = "WORK_ORDER_STATE", nullable = false)
	public boolean isWorkOrderState() {
		return this.workOrderState;
	}

	public void setWorkOrderState(boolean workOrderState) {
		this.workOrderState = workOrderState;
	}

	@Column(name = "WORK_ORDER_TYPE", nullable = false)
	public byte getWorkOrderType() {
		return this.workOrderType;
	}

	public void setWorkOrderType(byte workOrderType) {
		this.workOrderType = workOrderType;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "workOrder")
	public Set<QualityInspection> getQualityInspections() {
		return this.qualityInspections;
	}

	public void setQualityInspections(Set<QualityInspection> qualityInspections) {
		this.qualityInspections = qualityInspections;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "workOrder")
	public Set<WorkOrderDetail> getWorkOrderDetails() {
		return this.workOrderDetails;
	}

	public void setWorkOrderDetails(Set<WorkOrderDetail> workOrderDetails) {
		this.workOrderDetails = workOrderDetails;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "workOrder")
	public Set<SkillVerify> getSkillVerifies() {
		return this.skillVerifies;
	}

	public void setSkillVerifies(Set<SkillVerify> skillVerifies) {
		this.skillVerifies = skillVerifies;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "workOrder")
	public Set<StudentRecommend> getStudentRecommends() {
		return this.studentRecommends;
	}

	public void setStudentRecommends(Set<StudentRecommend> studentRecommends) {
		this.studentRecommends = studentRecommends;
	}

}
